package com.depin.pdaapp.utils;

import android.app.Application;
import android.content.Context;


/**
 * 所有需要初始化的操作，都放在 init()中
 * Created by xingzy on 2016/4/13.
 */
public class ApplicationHelper {
    private static ApplicationHelper mApplicationHelper;
    private Application mApp;

    private ApplicationHelper() {

    }

    public static ApplicationHelper getInstance() {
        if (null == mApplicationHelper) {
            mApplicationHelper = new ApplicationHelper();
        }
        return mApplicationHelper;
    }

    //如果使用该library必须执行
    public void init(Application application) {
        mApp = application;
    }

    public  Context getApplicationContext() {
        if (null != mApp) {
            return mApp.getApplicationContext();
        }
        return null;
    }

}
